<template>
    <el-dialog title="预定义变量" :visible.sync="getDialogStatus.stPredefine">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="系统默认" name="first">
                <el-collapse v-model="activeName2">
                    <el-collapse-item title="静港医美客户管理系统月度统计" name="1">
                        <div>
                            <el-checkbox v-model="currentMonth">当月到诊用户数据统计</el-checkbox>
                            <br>
                            {{currentMonthData}}
                        </div>
                    </el-collapse-item>
                   
                </el-collapse>
            </el-tab-pane>
            <el-tab-pane label="自定义" name="second">
                尚待完善
                <br><br>
            </el-tab-pane>
        </el-tabs>

    </el-dialog>
</template>

<script>

import {mapMutations,mapGetters} from 'vuex';

export default {
    props:{
       
    },
    data() {
        return {
           activeName:'first',
           activeName2:'1',
           currentMonth:false,
           currentMonthData:'',
        };
    },
    computed:{
        ...mapGetters(['getDialogStatus'])
    },
    watch:{
        currentMonth(newVal,oldVal){
            if(newVal){
                this.getCurrentMonthData();
            }
        }
    },
    methods:{
        ...mapMutations(['setDialogStatus','closeAllDialog']),
        handleClick(){

        },
        getCurrentMonthData(){
            axios.get('http://localhost:8000/api/v1/getCurrentMonthRanking?date=2018-01&platform=商务通').then((res)=>{
                this.currentMonthData=res.data;
                console.log(typeof this.currentMonthData);
            });
        }
    }
}
</script>

<style>

</style>
